package com.service.gmall.product.schedule;

import com.service.gmall.common.constant.SysRedisConst;
import com.service.gmall.product.bloom.BloomDataQueryService;
import com.service.gmall.product.bloom.BloomOpsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

/**
 * @author alpha
 * @className: RebuildBloomTask
 * @Description: 定时重建布隆任务
 */
@Service
public class RebuildBloomTask {
    @Autowired
    BloomOpsService bloomOpsService;
    @Autowired
    BloomDataQueryService bloomDataQueryService;


    //    @Scheduled(cron = "* * * * * ?")
    @Scheduled(cron = "0 0 3 ? * 3")
    public void rebuildBloom() {
//        System.out.println("testing...");
        bloomOpsService.rebuildBloom(SysRedisConst.BLOOM_SKUID, bloomDataQueryService);
    }
}
